#ifndef __ECHOSERVER_H__
#define __ECHOSERVER_H__

#include "TcpServer.h"
#include "ThreadPool.h"





class EchoServer
{
public:
    EchoServer(const string &ip, unsigned short port, size_t threadNum, size_t queueSize);
    ~EchoServer();

    void start();
    void stop();

private:
    void newConnectionCB(const TcpConnectionPtr &con);
    void CloseCB(const TcpConnectionPtr &con);
    void MessageCB(const TcpConnectionPtr &con);

private:
    TcpServer _server;
    ThreadPool _pool;
};

#endif